﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QuanLyQuangCao
{
    public partial class frmGD_KH : Form
    {

        public frmGD_KH()
        {
            InitializeComponent();
        }

        private void frmGD_KH_Load(object sender, EventArgs e)
        {
            setdata();
        }
        private DataSet ds = new DataSet();
        private void setdata()
        {
            string sql = "select * from khachhang";
            frmChinh.me.cn1.laydulieu(sql, frmChinh.me.sqlcon, ds, "khachhang");
            dataGridView1.DataSource = ds;
            dataGridView1.DataMember = "khachhang";
        }

        private void btnTrietKhau_Click(object sender, EventArgs e)
        {
            frmGD_KH_Edit fKH_S = new frmGD_KH_Edit();
            fKH_S.pMaKH = dataGridView1.CurrentRow.Cells[0].Value.ToString();
            fKH_S.pTenKH = dataGridView1.CurrentRow.Cells[1].Value.ToString();
            fKH_S.pTK = Convert.ToInt32(dataGridView1.CurrentRow.Cells[3].Value);
            fKH_S.ShowDialog();
            setdata();
        }
    }
}

﻿